package com.diandian.backend.store.dto;

import com.diandian.base.boot.starter.exception.DefaultException;

import java.io.Serializable;

public class OfflineStoreAddParamDTO implements Serializable {

	private String code;
	private String name;
	private String logo;
	private String contactUserName;
	private String contactTel;
	private String address;
	private String coordinate;
	private String remark;
	private String createUserId;
	private String createUserName;

	private String orgId;
	private String orgCode;
	private String belong;
	private String nodeCode;

	public void check(){
		if(this.code == null || "".equals(this.code)){
			throw new DefaultException("门店编码不能为空");
		}
		if(this.name == null || "".equals(this.name)){
			throw new DefaultException("门店名称不能为空");
		}
		if(this.belong == null || "".equals(this.belong)){
			throw new DefaultException("归属不能为空");
		}
		if(this.nodeCode == null || "".equals(this.nodeCode)){
			throw new DefaultException("节点不能为空");
		}
	}

	public StoreOfflineStoreInfoAddParamDTO toDTO(){
		StoreOfflineStoreInfoAddParamDTO dto = new StoreOfflineStoreInfoAddParamDTO();
		dto.setCode(this.code);
		dto.setName(this.name);
		dto.setLogo(this.logo);
		dto.setContactUserName(this.contactUserName);
		dto.setContactTel(this.contactTel);
		dto.setAddress(this.address);
		dto.setCoordinate(this.coordinate);
		dto.setRemark(this.remark);
		dto.setBelong(this.belong);
		dto.setCreateUserId(this.createUserId);
		dto.setCreateUserName(this.createUserName);
		dto.setOrgId(this.orgId);
		dto.setOrgCode(this.orgCode);
		return dto;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getLogo() {
		return logo;
	}

	public void setLogo(String logo) {
		this.logo = logo;
	}

	public String getContactUserName() {
		return contactUserName;
	}

	public void setContactUserName(String contactUserName) {
		this.contactUserName = contactUserName;
	}

	public String getContactTel() {
		return contactTel;
	}

	public void setContactTel(String contactTel) {
		this.contactTel = contactTel;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getCoordinate() {
		return coordinate;
	}

	public void setCoordinate(String coordinate) {
		this.coordinate = coordinate;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public String getCreateUserId() {
		return createUserId;
	}

	public void setCreateUserId(String createUserId) {
		this.createUserId = createUserId;
	}

	public String getCreateUserName() {
		return createUserName;
	}

	public void setCreateUserName(String createUserName) {
		this.createUserName = createUserName;
	}

	public String getOrgId() {
		return orgId;
	}

	public void setOrgId(String orgId) {
		this.orgId = orgId;
	}

	public String getOrgCode() {
		return orgCode;
	}

	public void setOrgCode(String orgCode) {
		this.orgCode = orgCode;
	}

	public String getBelong() {
		return belong;
	}

	public void setBelong(String belong) {
		this.belong = belong;
	}

	public String getNodeCode() {
		return nodeCode;
	}

	public void setNodeCode(String nodeCode) {
		this.nodeCode = nodeCode;
	}
}
